<template>
    <vechart :id="id"  :option="chartoption"></vechart>
</template>

<script>
    import vechart from './vechart.vue'

    export default {
        components: {vechart},
        props: ["id", "chartData"],
        data() {
            return {
                chartoption: {
                    tooltip: {
                        trigger: 'item',
                        formatter: '{a} <br/>{b} : {c} ({d}%)'
                    },
                    series: [
                        {
                            name: this.chartData.name,
                            type: 'pie',
                            radius: ['50%', '70%'],
                            center: ['50%', '60%'],
                            data: this.chartData.data,
                            itemStyle: {
                                emphasis: {
                                    shadowBlur: 10,
                                    shadowOffsetX: 0,
                                    shadowColor: 'rgba(0, 0, 0, 0.5)'
                                }
                            }
                        }
                    ]
                }
            }
        },
        mounted() {
        }
    };
</script>
